﻿var sDesc = "提供最新最多的高畫質(Full HD 1080)、國際、人文、運動、成人、音樂等頻道內容。<br />(標示HD為高畫質套餐頻道，綠色欄位為付費套餐頻道)";
//var cChannel = new Array(14,200,201,202,204,205,206,207,208,209,210,211,212,213,216,217,218,219,221,222,223,224,225,226,227,228,229,230,231,232,233,302,310,311,312,313,314,315,503,504,900,901,902,903,904,905,906,907,908,909,910,950,951,952,953,954,955,956,957,958,959,960,961,962,963,964,965,966,967,968,969,970,971,972,973,974,975,976,977,978,979);
//var cList = new Array(106,107,108,109,110,111,112,113,114,115,116,117,118,105,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,167,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185);
// 201,202 暫時下頻。311 下頻。4/19 修改
// 201,202 上頻。5/6 修改
// 14下頻, 214 上頻。7/1 & 6/25 修改
var cChannel = new Array(200,201,202,204,205,206,207,208,209,210,211,212,213,214,216,217,218,219,221,222,223,224,225,226,227,228,229,230,231,232,233,302,310,312,313,314,315,503,504,900,901,902,903,904,905,906,907,908,909,910,950,951,952,953,954,955,956,957,958,959,960,961,962,963,964,965,966,967,968,969,970,971,972,973,974,975,976,977,978,979);
var cList = new Array(107,108,109,110,111,112,113,114,115,116,117,118,105,186,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,167,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185);
switch(strMSO) {
	case "unc":
		var sTitle = "聯禾數位電視頻道表";
		break;
	case "gnc":
		var sTitle = "大新店數位電視頻道表";
		break;
	case "phn":
		var sTitle = "鳳信數位電視頻道表";
		break;
	case "mdc":
		var sTitle = "永佳樂數位電視頻道表";
		break;
	case "mgc":
		var sTitle = "紅樹林數位電視頻道表";
		break;
	case "gvc":
		var sTitle = "觀天下數位電視頻道表";
		break;
	case "lulu":
	case "fmg":
		var sTitle = "豐盟數位電視頻道表";
		break;
	case "ncc315":
	case "hpt":
		var sTitle = "新頻道數位電視頻道表";
		break;
	case "cto":
		var sTitle = "新竹振道數位電視頻道表";
		break;
	case "yms":
		var sTitle = "陽明山數位電視頻道表";
		break;
	case "dws":
		var sTitle = "大安文山數位電視頻道表";
		break;
	case "htp":
		var sTitle = "新台北數位電視頻道表";
		break;
	case "cpt":
		var sTitle = "金頻道數位電視頻道表";
		break;
	case "htc":
		var sTitle = "新唐城數位電視頻道表";
		break;
	case "along":
	case "cln":
		var sTitle = "全聯數位電視頻道表";
		break;
	case "nty":
		var sTitle = "北桃園數位電視頻道表";
		break;
	case "ntn":
		var sTitle = "南天數位電視頻道表";
		break;
	case "ksg":
		var sTitle = "觀昇數數位電視頻道表";
		break;
	case "pnc":
		var sTitle = "屏南數位電視頻道表";
		break;
}
var strBody;
strBody = "<div align=center><table border=0 class='minTab' bgcolor='#FFFFFF' width='660'><tr><td><table border=1 cellspacing=3 cellpadding=3 width='100%' class=minChannel><tbody><tr><td colspan=6 class=minDescTitle>" + sTitle + "<span class=minDesc> - " + cList.length + "個頻道";
if (sDesc != "") {strBody = strBody + "<br />" + sDesc};
strBody = strBody + "</span></td></tr><tr class=minTabTitle><td width=40>頻道</td><td width=180>名稱</td><td width=40 align=center>頻道</td><td width=180 align=center>名稱</td><td width=40 align=center>頻道</td><td width=180 align=center>名稱</td></tr>";

var intCols = Math.floor((cList.length)/3);
if (cList.length % 3 > 0) {intCols = intCols + 1;}

var intField;
for (var i=1;i<intCols+1;i++){
	strBody = strBody + "<tr>";
	for (var j=1;j<3+1;j++){
		intField = intCols * (j-1)+i-1;
		if (intField>=cList.length) {
			strBody = strBody + "<td>&nbsp;</td><td>&nbsp;</td>";
		} else {
			strBody = strBody + "<td class=minCh>" + cChannel[intField] + "</td><td";
			if ((cChannel[intField] > 900 && cChannel[intField] < 910) || (cChannel[intField] > 222 && cChannel[intField] < 300 && cChannel[intField] != 230)) {strBody = strBody + " class=minPayCH";}
			strBody = strBody + ">";
			if ((cChannel[intField] > 199 && cChannel[intField] < 223) || (cChannel[intField] == 230)) {strBody = strBody + "<img src=dtv_hd.gif>";}
			if (cUrl[cList[intField]] != "") {strBody = strBody + "<a href='" + cUrl[cList[intField]] + "' target='_blank'>";}
			strBody = strBody + cName[cList[intField]];
			if (cUrl[cList[intField]] != "") {strBody = strBody + "</a>";}
			strBody = strBody + "</td>";
		}
	}
	strBody = strBody + "</tr>"
}
strBody = strBody + "</table></td></tr></table></div>";

document.write(strBody);